#include "udpsocketthread.h"

UdpSocketThread::UdpSocketThread(const quint16 port, QObject *parent):
    QThread(parent), m_port(port)
{
    qRegisterMetaType<PIDS_RouteMsg>("PIDS_RouteMsg");
    qRegisterMetaType<PIDS_ControlPIDS>("PIDS_ControlPIDS");
}

UdpSocketThread::~UdpSocketThread()
{

}


void UdpSocketThread::run()
{
    CeUdpSocket *ceUdpSocket = new CeUdpSocket(m_port);
    connect(ceUdpSocket, SIGNAL(receRouteMsg(PIDS_RouteMsg)), this, SIGNAL(receRouteMsg(PIDS_RouteMsg)));
    connect(ceUdpSocket, SIGNAL(receCtlCmd(PIDS_ControlPIDS)), this, SIGNAL(receCtlCmd(PIDS_ControlPIDS)));

    exec();
}
